/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proj5labbd.graphics.emissora;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import proj5labbd.DBInterface;
import proj5labbd.graphics.MainFrame;
import proj5labbd.graphics.abstractOpGraphics.OperationFrame;

/**
 *
 * @author yole
 */
public class EmissoraFrame extends OperationFrame {
    
    private final int width = 665;
    private final int height = 580;
    
    public EmissoraFrame(MainFrame frame, DBInterface dbInterface) {
        super(frame);
//        jbtCancel.addActionListener(new EmissoraAction());
        int x = Toolkit.getDefaultToolkit().getScreenSize().width;
        int y = Toolkit.getDefaultToolkit().getScreenSize().height;
        this.setBounds((x-width)/2, (y-height)/2, width, height);
        this.setDefaultCloseOperation(EmissoraFrame.DISPOSE_ON_CLOSE);
        addPanel(new EmInsertPanel(this,dbInterface),OpPanel.INSERT);
        addPanel(new EmViewPanel(this,dbInterface),OpPanel.VIEW);
        addPanel(new EmRmPanel(this,dbInterface),OpPanel.REMOVE);
        this.setTitle("Emissora");
        super.jtbbOperation.addTab("Insert", null, insertPanel, "Inserir dados em emissora.");
        super.jtbbOperation.setMnemonicAt(0, KeyEvent.VK_1);
        super.jtbbOperation.addTab("View", null, viewPanel, "Visualizar dados em emissora.");
        super.jtbbOperation.setMnemonicAt(1, KeyEvent.VK_2);
        super.jtbbOperation.addTab("Remove", null, rmPanel, "Remover dados em emissora.");
        super.jtbbOperation.setMnemonicAt(2, KeyEvent.VK_3);
        super.jtbbOperation.setBounds((x-width)/2, (y-height)/2, width, height);
    }
    
//    class EmissoraAction implements ActionListener {
//    
//    public void actionPerformed(ActionEvent ae) {
//            if ( ae.getSource() == jbtCancel ) {
//                frame.dispose();
//            }
//        }
//    
//    }
  
}
